/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.kamionowski.supreme.admin.controller;

import java.security.Principal;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author soldier
 */
@Controller
@RequestMapping("/")
public class MainController {

    @RequestMapping("/index.html")
    public ModelAndView main(Principal principal){
        if(StringUtils.isNotBlank(principal.getName())){
            return new ModelAndView("mainPage");
        }else{
            return new ModelAndView("loginPage");
        }
        
    }
}
